﻿using System.Linq;
using System.Web.Mvc;
using Tyshka.Subroutines.Domain.Abstract;
using Tyshka.Subroutines.Filters;
using Tyshka.Subroutines.ViewModels;

namespace Tyshka.Subroutines.Controllers
{
    [AuthenticationFilter(false)]
    public class HomeController : Controller
    {
        public override string Name
        {
            get
            {
                return "Home";
            }
        }
        //
        // GET: /Home/

        public ActionResult Index()
        {
            var users = (IUserRepository)DependencyResolver.Current.GetService(typeof(IUserRepository));
            var total = users.Query();
            ViewData["Count"] = total.Count();
            return View();
        }

        public ActionResult Footer()
        {
            var model = new FooterViewModel
                            {
                                Version = "0.73 alpha",
                                BuildNo = 5,
                            };
            return PartialView("Footer", model);
        }
    }
}
